package com.ymttest.database.sqlwapper.stockmgr;

import java.util.List;

import com.ymt.database.SqlManager;
import com.ymttest.database.model.stockmgr.agentinventorysku;
import com.ymttest.database.model.stockmgr.agentinventoryskuExample;
import com.ymttest.utils.EnvSetup;

public class agentinventoryskuWapper {
	SqlManager manage;
	public agentinventoryskuWapper() {
		manage = new SqlManager("mysqlstockmgr" + EnvSetup.getEnv());

	}
	/**
	 * 查询出库规格
	 * @param example
	 * @return
	 * @throws InterruptedException
	 */
	public List<agentinventorysku> selectByExample(agentinventoryskuExample example) throws InterruptedException {
		@SuppressWarnings("unchecked")
		List<agentinventorysku> pia = manage.getSelectResults("com.ymttest.database.mapping.stockmgr.agentinventoryskuMapper.selectByExample", example);
		manage.commit();
		return pia;
	}
	
	/**
	 * 根据单号查询出库规格
	 * @param example
	 * @return
	 * @throws InterruptedException
	 */
	public List<agentinventorysku> selectByInventoryNo(String inventoryNo) throws InterruptedException {
		@SuppressWarnings("unchecked")
		agentinventoryskuExample example=new agentinventoryskuExample();
		example.createCriteria().andinventoryNoEqualTo(inventoryNo);
		List<agentinventorysku> pia = manage.getSelectResults("com.ymttest.database.mapping.stockmgr.agentinventoryskuMapper.selectByExample", example);
		manage.commit();
		return pia;
	}
}
